// 配置不同环境下的API请求前缀
let apidomains = {
  default: "https://wxashopapi-local.xiaokeduo.com",
  vshop: "https://wxashopapi-local.xiaokeduo.com"
}

let mtjServerUrl = "https://mpapi-local.xiaokeduo.com/MtjApi/Report"; ///流量统计API
let fundebugKey = "1ee60c35e5601a557b9ab5aba3e8f1771e0acd7268e469919cf47e8f659757b6"; ///fundebugKey

switch (process.env.NODE_ENV) {
  case "pro":
      apidomains = {
          default: "https://wxashopapi.yunquanlaile.com",
          vshop: "https://wxashopapi.yunquanlaile.com"
      };
      mtjServerUrl = "https://wxmpapi.yunquanlaile.com/MtjApi/Report";
      fundebugKey = "6a8e891767a20ed52f66dc6804e3364b8fc74ebf29757f02fe0079629b774567"; ///这个是生产环境的配置
      break;
  case "fat":
  case "fatb":
      apidomains = {
          default: "https://wxashopapi-dev.xiaokeduo.com",
          vshop: "https://wxashopapi-dev.xiaokeduo.com"
      };
      mtjServerUrl = "https://mpapi-dev.xiaokeduo.com/MtjApi/Report";
      fundebugKey = "1ee60c35e5601a557b9ab5aba3e8f1771e0acd7268e469919cf47e8f659757b6";
      break;
  case "dev":
  case "devb":
      apidomains = {
          default: "https://wxashopapi-local.xiaokeduo.com",
          vshop: "https://wxashopapi-local.xiaokeduo.com"
      };
      mtjServerUrl = "https://mpapi-local.xiaokeduo.com/MtjApi/Report";
      fundebugKey = "1ee60c35e5601a557b9ab5aba3e8f1771e0acd7268e469919cf47e8f659757b6";
      break;
  case "uat":
  case "uatb":
      apidomains = {
        default: "https://wxashopapi-uat.yunquanlaile.com",
        vshop: "https://wxashopapi-uat.yunquanlaile.com"
      };
      break;
  default:
      apidomains = {
          default: "https://wxashopapi-local.xiaokeduo.com",
          vshop: "https://wxashopapi-local.xiaokeduo.com"
      };
      mtjServerUrl = "https://mpapi-local.xiaokeduo.com/MtjApi/Report";
      fundebugKey = "1ee60c35e5601a557b9ab5aba3e8f1771e0acd7268e469919cf47e8f659757b6";
      break;
}

module.exports = {
  presets: [
    '@vue/app'
  ],
  plugins: [
    ['import', {
      libraryName: 'vant',
      libraryDirectory: 'es',
      style: true
    }, 'vant'],
    ['global-define', { _API_DOMAINS_: apidomains,_MTJ_SERURL_:mtjServerUrl,_FUND_KEY_:fundebugKey }] //定义环境变量
  ]
}